<?php
m2import('phpinchains/util/BundleTool.php');
m2import('phpinchains/PSPPage.php');
m2import('phpinchains/tagsupport/HtmlInput.php');
m2import('phpinchains/tagsupport/URL.php');
m2import('phpinchains/tagsupport/functions.inc.php');
class default__showThreadPSPPage extends phpinchains_PSPPage 
{
   var $validatormap;
   var $objcache;
   var $relativeFilePath = 'view/default/showThread.psp';
   function validateField (& $env, & $actionform, $fieldname, $validationParam, $validatormapping)
   {
       if (!is_object($this->objcache[$this->validatormap[$validatormapping]['class']]))
       {
           if (isset($this->validatormap[$validatormapping]['class']))           {
               if (m2import($this->validatormap[$validatormapping]['class'].'.php', true))               {
                   $classname = str_replace('/', '_', $this->validatormap[$validatormapping]['class']);
                   $this->objcache[$this->validatormap[$validatormapping]['class']] = new $classname();
               }               else               {
                   print '<strong>Validator not found! The registered validator \''.$this->validatormap[$validatormapping]['class'].'\' with mapping \'\'</strong>';               }
           }           else           {
               print '<strong>Validator not found! Is validator \''.$validatormapping.'\' registered in the action-config.xml of this module? (if conf:validators tag is missing in the config file than even the standard validators are not registered)</strong>';           }
       }
       $this->objcache[$this->validatormap[$validatormapping]['class']]->{$this->validatormap[$validatormapping]['method']}($env, $actionform, $fieldname, $validationParam);
   }

   function validate (& $dispatcher, & $env, & $actionform, $formname, $basedir)
   {
       $this->dispatcher = & $dispatcher;
       include($basedir.'action-config.xml.php');
       $this->validatormap = $validators;
       $validationErrors = & $actionform->getRef('validationErrors');
       $validationErrors->setForm($formname);
       
       return !$validationErrors->hasErrors();
   }
   function compilePSP ($sfile, $cfile, $viewname)
   {
       $this->dispatcher->compilePSP($sfile, $cfile, $viewname);
   }

   function render (& $dispatcher, & $env, & $actionform, $basedir)
   {
       $this->dispatcher = & $dispatcher;
       
 print "<html>
    <head><title>Default View</title></head>
    <body>
        <h1>Default View</h1>
    </body>
</html>";

   }
   function getJSCode (& $dispatcher, & $env, & $actionform)
   {
       $this->dispatcher = & $dispatcher;
       $jscode = "";
       return $jscode;
   }
}
?>